package com.sumover.DAO;

import com.sumover.POJO.Article;
import com.sumover.POJO.Comment;
import com.sumover.POJO.Game;
import com.sumover.POJO.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CommentMapper {
    int deleteByPrimaryKey(Integer cid);

    int insert(Comment record);

    Comment selectByPrimaryKey(Integer cid);

    List<Comment> selectAll();

    int updateByPrimaryKey(Comment record);

    List<Integer> getAllGameReplies(@Param("game") Game game);

    List<Integer> getAllGameComments(@Param("game") Game game);

    List<Integer> getAllArticleReplies(@Param("article") Article article);

    List<Integer> getAllArticleComments(@Param("article") Article article);

    void addGameComment(@Param("cid") Integer cid, @Param("gid") Integer gid);

    void addArticleComment(@Param("cid") Integer cid, @Param("aid") Integer aid);

    void addNewComment(@Param("user") User user, @Param("commentDetail") String commentText,
                       @Param("level") Integer level);

    Integer getMaxCommentId();

    void addArticleReply(@Param("rid") Integer rid, @Param("aid") Integer aid);

    void addGameReply(@Param("rid") Integer rid, @Param("gid") Integer gid);
}